package JLB_Chapter_05;

// StringIndexOf
public class code_05_05 {
    public static void main(String[] args) {
        String exap = "We are the best! the";
        int size1 = exap.indexOf("the");
        int size2 = exap.lastIndexOf("the");
        System.out.println(size1);
        System.out.println(size2);
        String str = "123456789abc";
        int charIndex = str.indexOf("abc");
        if (charIndex != -1) {
            System.out.println("str中存在“abc”字符串");
        } else {
            System.out.println("str中不存在“abc”字符串");
        }
    }
}
